package com.joysuch.wwyt.app.controller;

import com.joysuch.wwyt.app.service.AppRiskCompanyService;
import com.joysuch.wwyt.bp.entity.risk.BpReportSetting;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;

/**
 * @Author ZhangDong
 * @Date 2020/6/22 11:14
 */
@RestController
@RequestMapping("/bp/app/company")
@CrossOrigin
@Api(tags = "/bp/app/company App风险研判")
public class AppRiskCompanyController {

    @Autowired
    private AppRiskCompanyService appRiskCompanyService;

    /**
     * 当天部门汇总数据，如果没有则返回配置信息
     */
    @GetMapping("query-announce")
    @ApiOperation(value = "查询当天承诺公告数据", response = BpReportSetting.class)
    public ResultBean queryAnnounce(@RequestParam(value = "announceTime", required = false)
                                    @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate announceTime) {
        return appRiskCompanyService.queryAnnounce(announceTime);
    }
}
